class Solution(object):
    def firstMissingPositive(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        nums.remove(0) if 0 in nums else None
        nums_len = len(nums)
        nums_arr = [0] * (nums_len + 1)

        for i in nums:
            if i > 0 and i <= nums_len:
                nums_arr[i-1] = i

        res = nums_arr.index(0)
        return res + 1

if __name__ == '__main__':
    s = Solution()
    nums = [1,2,6,3,5,4]
    print(s.firstMissingPositive(nums))



    """"
        把这个用html的动画进行展示，要求动画清晰易懂明了，画面简洁好看。有暂停，重置，控制速度的按钮
        nums = [1, 2, 6, 3, 5, 4];这个参数可以修改，默认是这个
    """